package com.gxwzxy.medic.service.Impl;

import java.util.List;

import com.gxwzxy.medic.dao.RoleDao;
import com.gxwzxy.medic.dao.Impl.RoleDaoImpl;
import com.gxwzxy.medic.entity.Role;
import com.gxwzxy.medic.entity.otherentity.RoleMenu;
import com.gxwzxy.medic.service.RoleService;

public class RoleServiceImpl implements RoleService {

	/**
	 * 查询所有角色
	 */
	@Override
	public List<Role> findRole() {
		RoleDao rd = new RoleDaoImpl();
		return rd.findRole();
	}

	/**
	 * 根据Id删除角色
	 */
	@Override
	public boolean RoleDelete(String roleId) {
		RoleDao rd = new RoleDaoImpl();
		return rd.RoleDelete(roleId);
	}

	/**
	 * 添加角色
	 */
	@Override
	public boolean addRole(Role role, String[] menuId) {
		RoleDao rd = new RoleDaoImpl();
		return rd.addRole(role,menuId);
	}

	/**
	 * 根据role修改角色表
	 */
	@Override
	public boolean updateRoleByroleId(String roleId,String roleName) {
		RoleDao rd = new RoleDaoImpl();
		return rd.updateRoleByroleId(roleId,roleName);
	}

}
